package com.niuniu.rushdorm.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMQConfig {
    private static final String EXCHANGE = "directExchange";


    @Bean
    public DirectExchange directExchange(){
        return new DirectExchange(EXCHANGE);
    }


    @Bean
    public Queue logQueue(){
        return new Queue("log_queue");
    }

    @Bean
    public Binding logQueueBinding(){
        return BindingBuilder.bind(logQueue()).to(directExchange()).with("queue.log");
    }
}
